package com.imu.purse.modules.trade.service;

import com.imu.purse.modules.bitcoin.form.BitcoinForm;
import com.imu.purse.modules.trade.entity.FundEntity;

import java.util.List;

/**
 * 
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-03-31 12:04:14
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public interface FundService 
{
	/****
	 * 插入
	 * @param fund
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public int save(final FundEntity fund);
    
    /****
	 * 删除
	 * @param ids
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public boolean delete(final String ...ids);
    
    /****
	 * 修改
	 * @param fund
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public int update(final FundEntity fund);
    
     /****
	 * 插入或跟新
	 * @param fund
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public int saveUpdate(final FundEntity fund);
    
    /****
	 * 根据ID查询
	 * @param id
 	 * @date 2018-03-31 12:04:14
	 * @return
	 */
    public FundEntity findById(final Long id);
    
    /****
   	 * 分页查询
	 * @param fund
 	 * @date 2018-03-31 12:04:14
   	 * @return
   	 */
    public List<FundEntity> queryList(final FundEntity fund);
    
    /**
     * 修改用户的金额
     * @param fund
     * @return
     */
    public int upMoney(final FundEntity fund);
    
    /**
     * 修改用户的金额
     * @return
     */
    public int updateMoneyByUIdAndYtype(final FundEntity entity);
    
    /**
     * @param userId
     * @return
     */
    public FundEntity findByUserId(Long userId);
    
    
    /**
     * 实现内部转账
     * @param form
     * @return
     */
    
    public String transMoney(BitcoinForm form);
    
    public int up(final FundEntity entity);


	/**
	 * 根据用户地址获取用户ID，外部地址时，则不存在
	 * @param address
	 * @return
	 */
	public Long findUserIdByAdress(String address);

    /**
     * 私募修改
     * @return
     */
    public int upPri(final FundEntity entity);

}
